package com.wangcanxuan.www.controller.Impl;

import com.wangcanxuan.www.controller.NoticeController;
import com.wangcanxuan.www.entity.dto.ResultInfo;
import com.wangcanxuan.www.entity.po.Notice;
import com.wangcanxuan.www.proxy.ServiceProxy;
import com.wangcanxuan.www.service.Impl.NoticeServiceImpl;
import com.wangcanxuan.www.service.NoticeService;

import java.util.List;

/**
 * 通知controller层实现类
 *
 * @author HHLJ
 * @date 2022/04/08
 */
public class NoticeControllerImpl implements NoticeController {
    private final NoticeService noticeService = ServiceProxy.getProxyInstance(NoticeServiceImpl.class);

    @Override
    public ResultInfo<List<Notice>> getNotices(String userId, int pageCount) {
        return noticeService.getNotices(userId, pageCount);
    }

    @Override
    public ResultInfo<String> finishNotice(String chooseNoticeId) {
        ResultInfo<String> resultInfo = noticeService.finishNotice(chooseNoticeId);
        resultInfo.setMessage("阅读信息成功!");
        return resultInfo;
    }
}
